<template>
  <div class="AAL_module">
    <module-header
      :title="title"
      :meter="meter"
      :params="{
        module: 'AAG',
        status,
        Id: '',
        Bore: '',
        Cutting: ''
      }"
    />
    <section class="nameplate">
      <task-tab class="nameplate_content" :settings="nameplate_settings"></task-tab>
      <div class="remark">
        <span>备注：</span>
        <el-input v-model="remarks" type="textarea" :rows="10"></el-input>
      </div>
    </section>
    <section class="params">
      <div class="item">
        <span>单双流</span>
        <el-input size="mini" disabled></el-input>
      </div>
      <div class="item">
        <span>转换器编号</span>
        <el-input size="mini"></el-input>
      </div>
      <div class="item">
        <span>表体编号</span>
        <el-input size="mini"></el-input>
      </div>
      <div class="item">
        <span>直管段号</span>
        <el-input size="mini"></el-input>
      </div>
    </section>
    <section class="table">
      <record-table
        title="总装记录表"
        procedure="AAL"
        :meter="meter"
        :limits="RecordTableLimit"
        :params="{
          title,
          Cutting: ''
        }"
        :tableData="tableData"
        :tableColumnDict="tableColumnDict"
      ></record-table>
    </section>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator'
import { tableColumnDict, TableColumnType, nameplate_settings } from './params'
import ModuleHeader from '@/components/basic/ModuleHeader.vue'
import TaskTab from '@/views/dashboard/compoents/TaskTab.vue'
import RecordTable from '@/components/basic/RecordTable.vue'
import { Dictionary, SettingType } from '@/interface/Basic'
@Component({
  components: {
    ModuleHeader,
    TaskTab,
    RecordTable
  }
})
class AAL extends Vue {
  @Prop() status!: string
  @Prop({ default: '' }) meter!: string
  @Prop({ required: true }) title!: string
  tableData: TableColumnType[] = []
  tableColumnDict = tableColumnDict
  nameplate_settings: SettingType[] = nameplate_settings
  init_button_limit: Dictionary<boolean> = {
    // 保存
    AAG_0: true,
    // 删除
    AAG_1: true,
    // 新建
    AAG_2: true,
    // 读取三坐标
    AAG_3: true,
    // 手动选择三坐标
    AAG_4: true
  }
  get RecordTableLimit(): Dictionary<boolean> {
    const { AAG_0, AAG_1, AAG_2 } = this.init_button_limit
    return {
      Store: AAG_0,
      Create: AAG_2,
      Delete: AAG_1
    }
  }
  remarks: string = ''
}
export default AAL
</script>

<style lang="less" scoped>
@import '~@/styles/theme.less';
@import '~@/styles/layout.less';
.AAL_module {
  box-sizing: border-box;
  padding: 20px;
  width: 100%;
  height: 100%;
  #flex(column, flex-start, flex-start);
  section {
    box-sizing: border-box;
    padding: 10px;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 5px;
    #color(background-color, --module-bg-color);
    #shadow-color(0, 2px, 12px, 0, --primary-shadow-color);
  }
  .nameplate {
    max-height: 400px;
    overflow: auto;
    #flex(row, center, space-between);
    .nameplate_content {
      flex: 1;
    }
    .remark {
      box-sizing: border-box;
      padding-left: 20px;
      width: 300px;
      height: 100%;
      border-left: solid 1px;
      #flex(column, flex-start, flex-start);
      #color(border-left-color, --primary-border-color);
      span {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 5px;
        #color(color, --primary-text-color);
      }
      /deep/.el-input {
        flex: 1;
      }
    }
  }
  .params {
    flex-wrap: wrap;
    #flex(row, center, space-between);
    .item {
      flex: 1;
      margin-right: 10px;
      #flex(column, flex-start, flex-start);
      span {
        font-size: 14px;
        font-weight: 400;
        margin-bottom: 5px;
        #color(color, --primary-text-color);
      }
    }
    .item:first-child {
      span {
        #color(color, --primary-green-color);
      }
    }
    .item:last-child {
      margin-right: 0;
    }
  }
  .table {
    flex: 1;
    margin-bottom: 0;
    overflow: auto;
  }
}
</style>
